package com.elitel.frame.biz;


import com.elitel.common.core.domain.JsonResult;
import com.elitel.frame.base.service.SysMsgPushService;
import com.elitel.frame.main.entity.SysMsgPush;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("ecron")
public class EcronCtrl {
    @Resource
    private SysMsgPushService sysMsgPushService;

    @PostMapping("addJob")
    public JsonResult<?> addJob(@RequestBody SysMsgPush sysMsgPush) {
        String msg = sysMsgPushService.addJob(sysMsgPush);
        return JsonResult.success(msg);
    }

    @PostMapping("updateJob")
    public JsonResult<?> updateJob(@RequestBody SysMsgPush sysMsgPush) {
        String msg = sysMsgPushService.updateJob(sysMsgPush);
        return JsonResult.success(msg);
    }

    @GetMapping("pageJob")
    public JsonResult<?> pageJob(Integer pageNum, Integer pageSize) {
        Map<String, Object> msg = sysMsgPushService.pageJob(pageNum, pageSize);
        return JsonResult.success(msg);
    }


}
